package resolver

// This file will be automatically regenerated based on the schema, any resolver implementations
// will be copied through when generating and any unknown code will be moved to the end.

import (
	"context"
	"gqlt2/graph/model"

	"github.com/dgryski/trifles/uuid"
)

func (r *queryResolver) DictList(ctx context.Context, query model.DictListQuery) ([]*model.Dict, error) {
	return []*model.Dict{
		&model.Dict{
			DictType: &model.DictType{
				TypeCode: "ada",
				TypeName: "da",
			},
			DictValue: 1,
			DictName:  "caca",
		},
	}, nil
}

func (r *queryResolver) ProvinceList(ctx context.Context, query *model.ProvinceListQuery) ([]*model.Province, error) {
	return []*model.Province{
		&model.Province{
			ProvinceID: uuid.UUIDv4(),
			Name:       "ff",
			CityList: []*model.City{
				&model.City{
					CityID:       uuid.UUIDv4(),
					Name:         "cc",
					DistrictList: nil,
				},
			},
		},
	}, nil
}

func (r *queryResolver) CityList(ctx context.Context, query *model.CityListQuery) ([]*model.City, error) {
	return []*model.City{
		&model.City{
			CityID:       uuid.UUIDv4(),
			Name:         "dasda",
			DistrictList: nil,
			Province: &model.Province{
				ProvinceID: uuid.UUIDv4(),
				Name:       "dasda",
			},
		},
	}, nil
}

func (r *queryResolver) DistrictList(ctx context.Context, query *model.DistrictListQuery) ([]*model.District, error) {
	return []*model.District{
		&model.District{
			DistrictID: uuid.UUIDv4(),
			Name:       "dasda",
			Province: &model.Province{
				ProvinceID: uuid.UUIDv4(),
				Name:       "dasda",
			},
			City: &model.City{
				CityID: uuid.UUIDv4(),
				Name:   "caca",
			},
		},
	}, nil
}
